package com.captain.special.位运算;

/**
 * @author YangXiaoLong
 * 2022/12/2 10:46
 */
public class 只出现一次的数字136 {
    public int singleNumber(int[] nums) {
        int ans = nums[0];
        int len = nums.length;
        for (int i = 1; i < len; i++) {
            ans = ans ^ nums[i];
        }
        return ans;
    }
}
